Sample Scripts ReadMe

THIS CODE AND INFORMATION IS PROVIDED TO YOU FOR YOUR REFERENTIAL PURPOSES ONLY, AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE, AND MAY NOT BE REDISTRIBUTED IN ANY MANNER.

Copyright (c) Microsoft Corporation. All rights reserved.

● Activate Windows

● Bulk Import

● Devices Variables

● IIS Installation

● Operating System Unattended Installation

● SQL Installation

● Static IP

# Activate Windows

What

The Activate Windows sample script consists of a .vbs script and an Automated Deployment Services (ADS) task sequence.

● Activate-online.vbs — .vbs code for using standard APIs for activating Microsoft® Windows®

● Activate.xml — ADS sample script

Requirements

This script has only been tested with Microsoft Windows Server 2003. You should be able to include this code fragment at the end of an operating system configuration script. The code was not tested in this manner. You should review and test the code in a test environment prior to production deployment.

Instructions

1. Load the supplied .xml file as a job template in ADS.

2. Run the job template against a machine that is indicated in the ADS Administration Console as “Connected to Windows.”

# Bulk Import

What

Sample scripts for importing device information from a text file into an ADS controller.

● Bulkimport.cmd — Takes a .csv file as input and adds one machine and variables for each line of text in the file

● Metadata.csv — Sample input file

Requirements

This script has only been tested with ADS 1.0 on Windows Server 2003 Enterprise Edition. You should review and test the code in a test environment prior to production deployment.

Instructions

1. Update the metadata.csv file appropriate to your environment.

2. Run Bulkimport.cmd from a command-line window.

3. Verify data using the ADS Administration Console.

# Device Variables

What

Sample scripts for importing device variables into an ADS controller.

● CreateVar.cmd — Uses a list of devices in devices.txt to create device variables

● Devices.txt — Sample input file

Requirements

This script has only been tested with ADS 1.0 on Windows Server 2003 Enterprise Edition. You should review and test the code in a test environment prior to production deployment.

Instructions

1. Update the devices.txt file appropriate to your environment.

2. Run createvar.cmd from a command-line window.

3. Verify data using the ADS admin console.

# IIS Installation

What

Sample scripts for installing and uninstalling Internet Information Services (IIS) 6.0 on Windows Server 2003 using sysocmgr and an answer file. This technique is suitable for adding any “in-the-box” Windows Server components to an installation.

● ApplicationServerInstall.txt — Sample input file

● ApplicationServerInstall.xml — ADS sample sequence

● ApplicationServerUninstall.txt — Sample input file

● ApplicationServerUninstall.xml — ADS sample sequence

● Readme.txt — This document

● SetSourcePath.vbs —.vbs utility to update source path in the Windows registry

● VerifyWebServer.vbs —.vbs to validate a Web server

Requirements

The sample ADS task sequence is used in this example to install IIS. Any Windows components can be installed or uninstalled by modifying the Applicationserverinstall.txt file. The format of this file is the same as an unattended answer file for a Windows installation. See the .chm files in the deploy.cab file on the Windows CD for additional detail.

Note: The provided sample maps a drive letter to the controller and assumes the path will contain Windows setup files. Other more secure methods could be used to access Windows setup files, including adding the files to a directory path on the deployed image.

The sample script provided assumes the files exist in C:\Sample Scripts\IIS Install. You will need to update the path if you change the location of the scripts.

This script has only been tested with ADS 1.0 on Windows Server 2003 Enterprise Edition. You should review and test the code in a test environment prior to production deployment.

Instructions

1. Ensure that Windows source files are located properly, consistent with the path specified in the sample .xml files.

2. Update the password for your environment in the .xml file. For example:

<parameter>pass1word</parameter>

3. Load the supplied .xml file as a job template in ADS.

4. Run the job template against a machine that is “Connected to Windows.”

# Operating System Unattended Installation

What

This procedure will install a full operating system on a new (blank) target device using an unattended installation methodology. (Typical ADS operating system deployment is image-based using images prepared by sysprep.)

● PrepImage.bat — File that prepares a controller to host an unattended installation procedure

● Unattend.txt — Answer file used to configure the base operating system

● W2k3unattend.xml — Sample ADS sequence for performing an unattended installation

Important: This procedure will not function properly unless all settings are properly configured in the PrepImage.bat header (top section of the .bat file).

Unattended Installation Using ADS

1. Prepare an ADS image of Windows installation files (i386), including bootstrap files.

2. Deploy this image to a new system using an ADS sequence.

3. Personalize the image (computername, agent parameters, and so on).

4. Reboot the device. The unattended installation is started with a personalized answer file.

5. Cmdlines.txt file runs and installs the ADS agent.

6. On the final reboot the system comes back up and communicates to the controller.

7. Additional actions can be performed via the ADS deployment sequence.

Requirements

● This procedure runs on an ADS controller (dependencies on ADS utilities).

● Empty 500 megabyte (MB) volume as a drive letter; for example, "F:".

● The i386 directory from Windows 2003 CD (for example: c:\w2k3\i386).

● Customized unattended installation answer file (example c:\unattend.txt).

● Valid Windows product key (edit unattend.txt).

● Edit environment variables in PrepImage.bat for your environment.

Instructions

1. Create a 500 MB partition on your ADS controller and assign it a drive letter.

2. Format the new drive it with a no volume name.

3. Copy the contents of ADSunattend.zip to the c:\ directory on your controller.

4. Edit the productkey value in the unattend.txt with a valid product key.

5. Edit the environment variable section of PrepImage.bat to match your configuration.

6. Run Prepimage.bat to create the unattended installation image.

7. Prepare a new server (device) by booting up the Deployment Agent (you can do this to more than one machine).

8. Create an ADS device variable for each device called computername and give it a valid computername value.

9. Run the job w2k3unattend on the device (or you can target a set of devices).

10. The process should complete in 30 to 40 minutes.

11. Customize w2k3unattend.xml with additional post-os configuration tasks as needed.

# SQL Installation

What

Sample scripts for installing SQL Server™ 2000 and SQL Service Pack 3. This technique leverages standard SQL .iss answer files for an unattended installation of SQL Server.

● SQLinstall.xml — Sample ADS file for installing SQL Server

Requirements

The sample ADS task sequence is used in this example to install SQL using a mapped drive letter back to the controller. Controller variables are used to define the locations for the SQL source files. The default SP3a .iss answer file will need to be modified if using a default .iss installation of SQL. (See below.)

Note: The sample provided maps a drive letter to the controller and assumes the path will contain SQL setup files. Other more secure methods could be used to access Windows setup files, including adding the files to a directory path on the deployed image.

This script has only been tested with SQL 2000 Enterprise Edition and SQL Service Pack 3A with ADS 1.0 on Windows Server 2003 Enterprise Edition. You should review and test the code in a test environment prior to production deployment.

Instructions

1. Load the supplied .xml file as a job template in ADS.

2. Update the password for your environment in the .xml file. For example:

<parameter>pass1word</parameter>

3. Prepare the controller by placing the CD contents of SQL Server inc:\sql2k.ee.

4. SQL Service Pack 3 files should be located in c:\SQL2k.SP3a of the controller.

5. You must modify the file c:\sql2k.sp3a\sql2kdef.iss. The entry in this file, UpgradeMSSearch=1, should be set to 1 (when using a default installation of SQL2kee) in the same .iss file. You must also enter an administrator password (EnterPwd=pass1word and ConfirmPwd=pass1word options).

6. The script will map a drive (Y:) to the root c:\ of the controller. The agent is modified so that it runs "interactive" and the standard unattended files for SQL installation.

7. Run the job template against a machine that is “Connected to Windows.”

# Static IP

What

Sample scripts for configuring and ADS target device for static IP addresses. This is similar to the sample script provided with ADS 1.0. The difference with this script is that it can set Domain Name System (DNS) information and it uses the connection name to identify the NIC instead of the MAC address.

● SetConnIP.vbs —.vbs script to modify IP information for a connection

● SetConnIP.xml — Sample ADS .xml file for configuring IP information for a device

Requirements

This script is dependent on properly formatted device variables that include the proper data. The bulkimport.cmd script and input file provide sample data for this purpose.

This script has only been tested with ADS 1.0 on Windows Server 2003 Enterprise Edition. You should review and test the code in a test environment prior to production deployment.

Note: If you install the Adv Agent on a target device (a device that has not been deployed with ADS) manually, this device will lack the registry entry that includes the IP address of the ADS controller. Failure to have this IP address may mean that communications with this device across a routed segment will fail. You will be unable to control or run scripts on a device until you update the registry key. You can review a deployment script for the details on the registry key that is updated (typically) during a normal ADS device deployment sequence.

Instructions

1. Update the metadata.csv file appropriate to your environment.

2. Run Bulkimport.cmd from a command-line window to load device variables (or you may load device variables manually).

3. Load SetConnIP.xml as a job template using the ADS console.

4. Run the job on a device that is “Connected to Windows.”